package com.chuangjiangx.member.coupon.ddd.application;

import com.chuangjiangx.member.coupon.ddd.application.command.ActivateWxCardCommand;
import com.chuangjiangx.member.coupon.ddd.application.result.MbrActivateWxCardResult;
import com.chuangjiangx.member.coupon.ddd.domain.model.ActivateWxCard;
import com.chuangjiangx.member.coupon.ddd.domain.service.ActivateWxCardDomainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Auther: YZJ
 * @Date: 2018/9/4 17:02
 * @Description:
 */
@Service
public class ActivateWxCardApplication {
    @Autowired
    private ActivateWxCardDomainService activateWxCardDomainService;

    public MbrActivateWxCardResult activateWxCard(ActivateWxCardCommand cardCommand){
        ActivateWxCard activateWxCard = new ActivateWxCard(cardCommand.getCardId(), cardCommand.getEncryptCode(),cardCommand.getOpenid());
        return activateWxCardDomainService.activateWxCard(activateWxCard);
    }
}
